package com.whut.whw.util;

import android.support.design.widget.Snackbar;
import android.view.Gravity;
import android.view.View;
import android.widget.TextView;

import com.whut.whw.R;

/**
 * Created by 张芳容 on 2017/06/23.
 */

public final class SnackerbarUtils {
    public static void Show_snakerbar(View v, String msg){
        Snackbar snackbar=Snackbar.make(v, msg,Snackbar.LENGTH_LONG);
        TextView textView =(TextView) snackbar.getView().findViewById(R.id.snackbar_text);//获取Snackbar的view
        if(textView!=null){
            textView.setGravity(Gravity.CENTER);//获取Snackbar的message控件，修改字体颜色
        }
        snackbar.show();
    }
}
